# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=oscanner
pkgver=1.0.6
pkgrel=7
groups=('blackarch' 'blackarch-fuzzer')
pkgdesc='An Oracle assessment framework developed in Java.'
arch=('any')
url='http://www.cqure.net/wp/oscanner/'
license=('GPL')
depends=('java-environment')
#source=("http://www.cqure.net/tools/oscanner_bin_${pkgver//./_}.zip")
source=("https://web.archive.org/web/20100703011035/http://www.cqure.net/tools/oscanner_bin_${pkgver//./_}.zip")
sha512sums=('8da3aac1d07c829497822e101b29c7a5b7e723841e468b79a10f69deed07122abf181c5e4a642b9c7314841017fadabc955ed2fc552d4c7e3e53d3ef259d253b')

prepare() {
  cd oscanner_bin

  sed -i "4i\\cd /usr/share/oscanner" *.sh
}

package() {
  cd oscanner_bin

  rm COPYING

  # This isn't Windows.
  rm *.exe

  # This isn't a FAT filesystem.
  chmod -R 644 .
  chmod -R +X .
  chmod +x *.sh

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp --no-preserve=ownership -r * "$pkgdir/usr/share/$pkgname/"

  mv "$pkgdir/usr/share/$pkgname/$pkgname.sh" "$pkgdir/usr/bin/$pkgname"
  mv "$pkgdir/usr/share/$pkgname/reportviewer.sh" "$pkgdir/usr/bin/reportviewer"
}

